<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="codeDicId" value="#{codeDicHome.id}"></f:viewParam>
	   	<f:event listener="#{codeDicHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="代码表管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="#{codeDicHome.managed ? '修改' : '新增'}代码表" style="margin-bottom:10px;">
		        <p:messages id="messages" autoUpdate="true" closable="true"/>		
		        
		        <h:panelGrid columns="2" cellpadding="5">
					<p:outputLabel for="codeName" value="代码名称" />				
					<p:inputText id="codeName" 
							  value="#{codeDicHome.instance.codeName}"
							  styleClass="input-large"
						   required="true" />
						   
					<p:outputLabel for="codeValue" value="代码值" />				
					<p:inputText id="codeValue" 
							  value="#{codeDicHome.instance.codeValue}"
							  styleClass="input-large"
						   required="true" />
						   	   
				    <p:outputLabel for="codeType" value="代码类型" />
					<p:inputText id="codeType"
								 value="#{codeDicHome.instance.codeType}"
								 styleClass="input-large"
								 required="true" />
					<p:outputLabel for="sort" value="排序" />
					<p:inputText id="sort"
								 value="#{codeDicHome.instance.sort}"
								 required="true" />
				</h:panelGrid>
			</p:panel>
			<p:tooltip for="sort" value="值越大，越靠前！" />
			<p:commandButton action="#{codeDicHome.saveAndFlush()}" value="保存" ajax="false" />
			<p:commandButton value="删除" action="#{codeDicHome.delete()}">
				<p:confirm header="请确认" message="您确认删除记录吗?" icon="ui-icon-alert" />
			</p:commandButton>
			<p:button outcome="CodeDicList.xhtml" value="取消" />
			<p:confirmDialog id="confirmDialog" global="true" showEffect="fade" hideEffect="explode" widgetVar="confirmDialog">
			    <p:commandButton value="确认" styleClass="ui-confirmdialog-yes"></p:commandButton>
			    <p:commandButton value="取消" immediate="true" styleClass="ui-confirmdialog-no" />
			</p:confirmDialog>
		</h:form>
      
   	</ui:define>
</ui:composition>
